The present invention relates to partial file caching. More specifically, the invention relates to allowing local read and write requests while enabling partial file caching on a file system block boundary.
When a caching relationship is established between two file systems, one system cache presents a view of the other system, also known as remote. One mechanism of implementing a caching file system is to perform whole file caching. In such a system, when a file is read, the file system is aware if the file has been cached in its entirety. A file is either marked “cached” or “uncached”. If a read request is made on an uncached file, the cache system does not have a way to determine if the request can be satisfied with data that is already present in the cache even if the data was previously read, and must make a request to a remote system to fetch the data. Until the file is marked cached after the whole file has been pre-fetched into the cache, all read requests must be forwarded to the remote system. Similarly, any in-place write requests and new allocations or file appends made to an uncached file must wait until the entire file has been pre-fetched. Accordingly, reading any part of a file causes all the contents of the file to be fetched from persistent storage and stored locally in the cache.